import fs from 'fs-extra'

export function testFilePath(path: string[]) {
  if (!path.length) throw new Error('path not provide')

  const p = path.find(p => fs.pathExists(p))
  if (p) return p

  return path[path.length - 1]
}
